import { atom } from "jotai";
import portrait_default from "@/assets/createTask/portrait_default.png"
export interface UserInfoType {
	is_pro: boolean;
	points: {
		free_times: number;
		user_id: number;
		free_points:number;
		charge_points:number;
	};
	user_info_json: {
		avatar: string;
		birthday: string;
		gender: string;
		nickname: string;
		result_bg_img:string;
	};
	user_id:number;
	uuid:string;
}

export interface UserImgItemType {
	id:number;
	full_path:string
}

// 用户信息
export const userInfoAtom = atom<UserInfoType>({
    is_pro: false,
	points: {
		free_times: 0,
		user_id:0,
		charge_points:0,
		free_points:0
	},
	user_info_json: {
		avatar: '',
		birthday:'',	
        gender: '',
		nickname: '',
		result_bg_img:''
	},
	user_id:0,
	uuid:''
});

// 用户图片列表
export const userImgListAtom = atom<UserImgItemType[]>([])

// 用户选择的图片信息
export const userImgParamsAtom = atom<UserImgItemType>({
	id:0,
	full_path:portrait_default
})

